package com.twu.biblioteca;

abstract class Record {
    protected final int id;
    protected final String title;
    private final RecordType recordType;
    public RecordState status = RecordState.AVAILABLE;


    public Record(int id, String title, RecordState status, RecordType recordType) {
        this.id = id;
        this.title = title;
        this.status = status;
        this.recordType = recordType;
    }

    public void setStatus(RecordState newStatus){
        status = newStatus;
    }

    public RecordState getStatus(){
        return status;
    }

    public boolean isAvailable() {
        return this.status == RecordState.AVAILABLE;
    }

    public abstract boolean isBook();

    public abstract boolean isMovie();


    public int getId() {
        return id;
    }

    public String getTitle() {
        return title;
    }

    @Override
    public String toString() {
        return id + "." + title;
    }
}
